package timer;

import java.util.Date;
import java.util.TimerTask;

public class FoolTimerTask extends TimerTask {

    private String taskName;

    public FoolTimerTask(String taskName) {
        this.taskName = taskName;
    }

    @Override
    public void run() {
        System.out.println("taskName=" + taskName + ",startTime=" + new Date().toLocaleString());
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("taskName=" + taskName + ",endTime=" + new Date().toLocaleString());
    }
}
